<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up()
    {
        /**
         * 景点图片
         */
        Schema::create('scenic_spot_images', function (Blueprint $table) {
            $table->id();
            $table->string('scenic_id',32)->comment('景点id');
            $table->tinyInteger('type')->comment('类型 1 首图 2 其他');
            $table->string('origin_url',255)->comment('图片地址原始 可以对比 剔除或更新 ');
            $table->string('url',255)->default('')->comment('图片地址,oss 链接 用cos 如果图片较多异步更新');
            $table->timestamps();
            $table->index(['scenic_id','type'],'idx_spot_type');
        });
    }

    public function down()
    {
        Schema::dropIfExists('scenic_spot_images');
    }
};
